// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file wind_estimate.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "wind_estimate.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

wind_estimate::wind_estimate()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_windspeed_north_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61f8bee4
    m_windspeed_north_ = 0.0;
    // m_windspeed_east_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7b49cea0
    m_windspeed_east_ = 0.0;
    // m_variance_north_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_variance_north_ = 0.0;
    // m_variance_east_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fac631b
    m_variance_east_ = 0.0;
    // m_tas_innov_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5b87ed94
    m_tas_innov_ = 0.0;
    // m_tas_innov_var_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@47ef968d
    m_tas_innov_var_ = 0.0;
    // m_tas_scale_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@23e028a9
    m_tas_scale_ = 0.0;
    // m_beta_innov_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@3dd4520b
    m_beta_innov_ = 0.0;
    // m_beta_innov_var_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5ae63ade
    m_beta_innov_var_ = 0.0;

}

wind_estimate::~wind_estimate()
{










}

wind_estimate::wind_estimate(const wind_estimate &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_windspeed_north_ = x.m_windspeed_north_;
    m_windspeed_east_ = x.m_windspeed_east_;
    m_variance_north_ = x.m_variance_north_;
    m_variance_east_ = x.m_variance_east_;
    m_tas_innov_ = x.m_tas_innov_;
    m_tas_innov_var_ = x.m_tas_innov_var_;
    m_tas_scale_ = x.m_tas_scale_;
    m_beta_innov_ = x.m_beta_innov_;
    m_beta_innov_var_ = x.m_beta_innov_var_;
}

wind_estimate::wind_estimate(wind_estimate &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_windspeed_north_ = x.m_windspeed_north_;
    m_windspeed_east_ = x.m_windspeed_east_;
    m_variance_north_ = x.m_variance_north_;
    m_variance_east_ = x.m_variance_east_;
    m_tas_innov_ = x.m_tas_innov_;
    m_tas_innov_var_ = x.m_tas_innov_var_;
    m_tas_scale_ = x.m_tas_scale_;
    m_beta_innov_ = x.m_beta_innov_;
    m_beta_innov_var_ = x.m_beta_innov_var_;
}

wind_estimate& wind_estimate::operator=(const wind_estimate &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_windspeed_north_ = x.m_windspeed_north_;
    m_windspeed_east_ = x.m_windspeed_east_;
    m_variance_north_ = x.m_variance_north_;
    m_variance_east_ = x.m_variance_east_;
    m_tas_innov_ = x.m_tas_innov_;
    m_tas_innov_var_ = x.m_tas_innov_var_;
    m_tas_scale_ = x.m_tas_scale_;
    m_beta_innov_ = x.m_beta_innov_;
    m_beta_innov_var_ = x.m_beta_innov_var_;

    return *this;
}

wind_estimate& wind_estimate::operator=(wind_estimate &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_windspeed_north_ = x.m_windspeed_north_;
    m_windspeed_east_ = x.m_windspeed_east_;
    m_variance_north_ = x.m_variance_north_;
    m_variance_east_ = x.m_variance_east_;
    m_tas_innov_ = x.m_tas_innov_;
    m_tas_innov_var_ = x.m_tas_innov_var_;
    m_tas_scale_ = x.m_tas_scale_;
    m_beta_innov_ = x.m_beta_innov_;
    m_beta_innov_var_ = x.m_beta_innov_var_;

    return *this;
}

size_t wind_estimate::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

size_t wind_estimate::getCdrSerializedSize(const wind_estimate& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

void wind_estimate::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_windspeed_north_;
    scdr << m_windspeed_east_;
    scdr << m_variance_north_;
    scdr << m_variance_east_;
    scdr << m_tas_innov_;
    scdr << m_tas_innov_var_;
    scdr << m_tas_scale_;
    scdr << m_beta_innov_;
    scdr << m_beta_innov_var_;
}

void wind_estimate::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_windspeed_north_;
    dcdr >> m_windspeed_east_;
    dcdr >> m_variance_north_;
    dcdr >> m_variance_east_;
    dcdr >> m_tas_innov_;
    dcdr >> m_tas_innov_var_;
    dcdr >> m_tas_scale_;
    dcdr >> m_beta_innov_;
    dcdr >> m_beta_innov_var_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void wind_estimate::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t wind_estimate::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& wind_estimate::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member windspeed_north_
 * @param _windspeed_north_ New value for member windspeed_north_
 */
void wind_estimate::windspeed_north_(float _windspeed_north_)
{
m_windspeed_north_ = _windspeed_north_;
}

/*!
 * @brief This function returns the value of member windspeed_north_
 * @return Value of member windspeed_north_
 */
float wind_estimate::windspeed_north_() const
{
    return m_windspeed_north_;
}

/*!
 * @brief This function returns a reference to member windspeed_north_
 * @return Reference to member windspeed_north_
 */
float& wind_estimate::windspeed_north_()
{
    return m_windspeed_north_;
}

/*!
 * @brief This function sets a value in member windspeed_east_
 * @param _windspeed_east_ New value for member windspeed_east_
 */
void wind_estimate::windspeed_east_(float _windspeed_east_)
{
m_windspeed_east_ = _windspeed_east_;
}

/*!
 * @brief This function returns the value of member windspeed_east_
 * @return Value of member windspeed_east_
 */
float wind_estimate::windspeed_east_() const
{
    return m_windspeed_east_;
}

/*!
 * @brief This function returns a reference to member windspeed_east_
 * @return Reference to member windspeed_east_
 */
float& wind_estimate::windspeed_east_()
{
    return m_windspeed_east_;
}

/*!
 * @brief This function sets a value in member variance_north_
 * @param _variance_north_ New value for member variance_north_
 */
void wind_estimate::variance_north_(float _variance_north_)
{
m_variance_north_ = _variance_north_;
}

/*!
 * @brief This function returns the value of member variance_north_
 * @return Value of member variance_north_
 */
float wind_estimate::variance_north_() const
{
    return m_variance_north_;
}

/*!
 * @brief This function returns a reference to member variance_north_
 * @return Reference to member variance_north_
 */
float& wind_estimate::variance_north_()
{
    return m_variance_north_;
}

/*!
 * @brief This function sets a value in member variance_east_
 * @param _variance_east_ New value for member variance_east_
 */
void wind_estimate::variance_east_(float _variance_east_)
{
m_variance_east_ = _variance_east_;
}

/*!
 * @brief This function returns the value of member variance_east_
 * @return Value of member variance_east_
 */
float wind_estimate::variance_east_() const
{
    return m_variance_east_;
}

/*!
 * @brief This function returns a reference to member variance_east_
 * @return Reference to member variance_east_
 */
float& wind_estimate::variance_east_()
{
    return m_variance_east_;
}

/*!
 * @brief This function sets a value in member tas_innov_
 * @param _tas_innov_ New value for member tas_innov_
 */
void wind_estimate::tas_innov_(float _tas_innov_)
{
m_tas_innov_ = _tas_innov_;
}

/*!
 * @brief This function returns the value of member tas_innov_
 * @return Value of member tas_innov_
 */
float wind_estimate::tas_innov_() const
{
    return m_tas_innov_;
}

/*!
 * @brief This function returns a reference to member tas_innov_
 * @return Reference to member tas_innov_
 */
float& wind_estimate::tas_innov_()
{
    return m_tas_innov_;
}

/*!
 * @brief This function sets a value in member tas_innov_var_
 * @param _tas_innov_var_ New value for member tas_innov_var_
 */
void wind_estimate::tas_innov_var_(float _tas_innov_var_)
{
m_tas_innov_var_ = _tas_innov_var_;
}

/*!
 * @brief This function returns the value of member tas_innov_var_
 * @return Value of member tas_innov_var_
 */
float wind_estimate::tas_innov_var_() const
{
    return m_tas_innov_var_;
}

/*!
 * @brief This function returns a reference to member tas_innov_var_
 * @return Reference to member tas_innov_var_
 */
float& wind_estimate::tas_innov_var_()
{
    return m_tas_innov_var_;
}

/*!
 * @brief This function sets a value in member tas_scale_
 * @param _tas_scale_ New value for member tas_scale_
 */
void wind_estimate::tas_scale_(float _tas_scale_)
{
m_tas_scale_ = _tas_scale_;
}

/*!
 * @brief This function returns the value of member tas_scale_
 * @return Value of member tas_scale_
 */
float wind_estimate::tas_scale_() const
{
    return m_tas_scale_;
}

/*!
 * @brief This function returns a reference to member tas_scale_
 * @return Reference to member tas_scale_
 */
float& wind_estimate::tas_scale_()
{
    return m_tas_scale_;
}

/*!
 * @brief This function sets a value in member beta_innov_
 * @param _beta_innov_ New value for member beta_innov_
 */
void wind_estimate::beta_innov_(float _beta_innov_)
{
m_beta_innov_ = _beta_innov_;
}

/*!
 * @brief This function returns the value of member beta_innov_
 * @return Value of member beta_innov_
 */
float wind_estimate::beta_innov_() const
{
    return m_beta_innov_;
}

/*!
 * @brief This function returns a reference to member beta_innov_
 * @return Reference to member beta_innov_
 */
float& wind_estimate::beta_innov_()
{
    return m_beta_innov_;
}

/*!
 * @brief This function sets a value in member beta_innov_var_
 * @param _beta_innov_var_ New value for member beta_innov_var_
 */
void wind_estimate::beta_innov_var_(float _beta_innov_var_)
{
m_beta_innov_var_ = _beta_innov_var_;
}

/*!
 * @brief This function returns the value of member beta_innov_var_
 * @return Value of member beta_innov_var_
 */
float wind_estimate::beta_innov_var_() const
{
    return m_beta_innov_var_;
}

/*!
 * @brief This function returns a reference to member beta_innov_var_
 * @return Reference to member beta_innov_var_
 */
float& wind_estimate::beta_innov_var_()
{
    return m_beta_innov_var_;
}


size_t wind_estimate::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;













    return current_align;
}

bool wind_estimate::isKeyDefined()
{
   return false;
}

void wind_estimate::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
     
     
     
     
     
}
